package component;
/**
 * emial对象
 * @author yanghao
 * 2015年7月8日 上午11:12:12
 */
public class Email {
	/**
	 * 简单邮件
	 */
	public static final int SIMPLE_EMAIL = 1;
	/**
	 * html模板邮件
	 */
	public static final int HTML_EMIAL = 2;
	
	private Email(){}
	
	/**
	 * 必须以该构造器构造邮件
	 * @param sendTo 收件人
	 * @param from	发件人
	 * @param subject	主题
	 * @param content	内容
	 * @param type	类型：请参考静态常量
	 */
	public Email(String sendTo, String from, String subject, String content,
			int type) {
		super();
		this.sendTo = sendTo;
		this.from = from;
		this.subject = subject;
		this.content = content;
		if(type!=SIMPLE_EMAIL&&type!=HTML_EMIAL){
			this.type = SIMPLE_EMAIL;
		}else{
			this.type = type;
		}
	}
	
	public Email(String sendTo,String subject, String content,
			int type) {
		super();
		this.sendTo = sendTo;
		this.subject = subject;
		this.content = content;
		if(type!=SIMPLE_EMAIL&&type!=HTML_EMIAL){
			this.type = SIMPLE_EMAIL;
		}else{
			this.type = type;
		}
	}


	/**
	 * 收件人
	 */
	private String sendTo;
	/**
	 * 发件人
	 */
	private String from;
	/**
	 * 主题
	 */
	private String subject;
	/**
	 * 内容
	 */
	private String content;
	/**
	 * 1.简单邮件
	 * 2.html模板邮件
	 */
	private int type;

	public String getSendTo() {
		return sendTo;
	}

	public String getFrom() {
		return from;
	}

	public String getSubject() {
		return subject;
	}

	public String getContent() {
		return content;
	}

	public int getType() {
		return type;
	}

	@Override
	public String toString() {
		return "Email [sendTo=" + sendTo + ", from=" + from + ", subject="
				+ subject + ", content=" + content + ", type=" + type + "]";
	}
	
	
}
